Strictness Analysis for Attribute Grammars
نویسنده
چکیده
Attribute grammars may be seen as a (rather specialised) lazy or demand-driven programming language. The “programs” in this language take text or parse trees as input and return values of the synthesised attributes to the root as output. From this observation we establish a framework for abstract interpretation of attribute grammars. The framework is used to construct a strictness analysis for attribute grammars. Results of the analysis enable us to transform an attribute grammar such that attributes are evaluated during parsing, if possible. The analysis is proved correct by relating it to a fixpoint semantics for attribute grammars. An implementation of the analysis is discussed and some extensions to the analysis are mentioned.
منابع مشابه
A finest partitioning algorithm for attribute grammars
The attribute dependence graph of a syntax tree may be partitioned into disjoint regions. Attribute instances in dierent regions are independent of one other. The advantages of partitioning the attribute dependence graph include simplifying the attribute grammar conceptually and allowing the possibility of parallel evaluation. We present a static partitioning algorithm for attribute grammars. ...
متن کاملModular Well-Definedness Analysis for Attribute Grammars
Extension developers deal with errors User has no conflict errors The full solution consists of: Forwarding Van Wyk. de Moor. Backhouse. Kwiathowski. "Forwarding in attribute grammars for modular language design." CC '02 Copper's modular analysis for syntax Schwerdfeger. Van Wyk. "Verifiable composition of deterministic grammars." PLDI '09 Silver's modular analysis for semantics Kaminski. Van W...
متن کاملAttribute Grammars and Automatic Complexity Analysis Attribute Grammars and Automatic Complexity Analysis Attribute Grammars and Automatic Complexity Analysis
Decomposable combinatorial structures have been well studied and a systematic manner for determining generating function equations is well known. Attribute grammars have enhanced the study of context-free grammars by giving meaning to constructions. Delest and F edou 2] showed that attribute grammars extend to combinatorial structures, with applications to random generation. In a similar way, w...
متن کاملEfficient Evaluation of Well-Formed Attribute Grammars And Beyond
This paper is concerned with the evaluation of well-formed attribute grammars as support for semantic analysis. This is the largest class of attribute grammars, which does not impose any restrictions. A data structure and an algorithm are described which are efficient, both in terms of space and time. Attribute grammars are extended from the decoration of trees to the decoration of graphs and t...
متن کاملEmbedding attribute grammars and their extensions using functional zippers
Embedding Attribute Grammars and their Extensions using Functional Zippers Attribute grammars are a suitable formalism to express complex software language analysis and manipulation algorithms, which rely on multiple traversals of the underlying syntax tree. Attribute Grammars have been extended with mechanisms such as references, higher order and circular attributes. Such extensions provide a ...
متن کامل